package com.yao.mybatis.sqlsession;

import com.yao.mybatis.config.Configuration;
import com.yao.mybatis.config.XMLConfigParser;

import java.io.InputStream;

/**
 * create sqlsessionfactory
 * @author Administrator
 */
public class SqlSessionFactoryBuilder {
    public SqlSessionFactory build(InputStream inputStream) {
        XMLConfigParser parser = new XMLConfigParser();
        Configuration configuration = parser.parse(inputStream);
        return new DefaultSqlSessionFactory(configuration);
    }

}
